#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::contextMenuEvent(QContextMenuEvent *event)
{
    QMenu menu(this);
    QMenu * menu1 =   menu.addMenu("文件");
    menu1->addAction("test1");
    menu1->addAction("test2");
    menu1->addAction("test3");
    menu.addSeparator();
    menu.addAction("复制");
    menu.addAction("粘贴");

    menu.exec(event->globalPos());

}

